package com.example.rocketspringbootsuper.bean;

import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.common.message.MessageExt;
import org.springframework.context.ApplicationEvent;

import java.io.Serializable;
import java.util.List;

/**
 * @ClassName MessageEvent
 * @Author swj
 * @Date 2020/9/28 16:50
 */
public class MessageEvent extends ApplicationEvent implements Serializable {

    private static final long serialVersionUID = -4468405250074063206L;
    private DefaultMQPushConsumer consumer;
    private List<MessageExt> msgs;

    /**
     * Create a new {@code ApplicationEvent}.
     *
     * @param
     */
    public MessageEvent(List<MessageExt> msgs,DefaultMQPushConsumer consumer) {
        super(msgs);
        this.consumer=consumer;
        this.setMsgs(msgs);
    }

    public DefaultMQPushConsumer getConsumer() {
        return consumer;
    }

    public void setConsumer(DefaultMQPushConsumer consumer) {
        this.consumer = consumer;
    }

    public List<MessageExt> getMsgs() {
        return msgs;
    }

    public void setMsgs(List<MessageExt> msgs) {
        this.msgs = msgs;
    }
}
